# coding:utf-8
import os
basedir = os.path.abspath(os.path.dirname(__file__))

class Config(object):
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'XXXXXXXXXX'
    SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    FLASK_ADMIN = '2632790902@qq.com'
    FLASK_POSTS_PER_PAGE = 15

    HEAD_DIR = basedir + '\\project\\static\\images\\heads\\'

    @staticmethod
    def init_app(app):
        pass


class DevelopmentConfig(Config):
    # SQL CONFIG
    # SQL statement:
    #   CREATE DATABASE IF NOT EXISTS dev DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
    #   GRANT ALL PRIVILEGES ON dev.* TO 'uniyes'@'localhost' IDENTIFIED BY 'uniyes123' WITH GRANT OPTION;
    SQLALCHEMY_DATABASE_URI = 'mysql://uniyes:uniyes123@127.0.0.1/my_blog_dev?charset=utf8'
    SQLALCHEMY_ECHO = True

    DEBUG = True


class IntegrationConfig(DevelopmentConfig):
    pass


class TestingConfig(Config):
    pass


class IntegrationTestingConfig(TestingConfig):
    pass


class ProductionConfig(Config):
    pass


config = {
    'development': DevelopmentConfig,
    'integration': IntegrationConfig,  # for cjj
    'testing': TestingConfig,
    'integration_testing': IntegrationTestingConfig,  # test cjj
    'production': ProductionConfig
}
